from pydantic import BaseModel, Field
from typing import Optional, List, Union


class TokenPair(BaseModel):
    access_token: str
    refresh_token: str
    token_type: str = Field("bearer", description="令牌类型")


class MeResponse(BaseModel):
    id: Optional[int] = None
    username: str
    name: Optional[str] = None
    avatar: Optional[str] = None
    email: Optional[str] = None
    phone: Optional[str] = None
    department: Optional[str] = None
    roles: Optional[List[Union[int, str]]] = None
    person_id: Optional[int] = None